package com.shop.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.shop.mapper.ScheduleLogMapper;
import com.shop.model.PageParam;
import com.shop.model.dto.ScheduleLog;
import com.shop.model.vo.Rsp;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * (ScheduleLog)表服务接口
 *
 * @author makejava
 * @since 2020-11-28 11:41:28
 */
@Service
@AllArgsConstructor
public class ScheduleLogService {
    private final ScheduleLogMapper scheduleLogMapper;

    public Rsp getScheduleLog(PageParam<ScheduleLog> pageParam) {
        PageHelper.startPage(pageParam.getPageNum(), pageParam.getPageSize());
        List<ScheduleLog> list = scheduleLogMapper.selectList(new QueryWrapper<ScheduleLog>().eq("job_id", pageParam.getModel().getJobId()));
        return Rsp.success(new PageInfo<>(list));
    }
}
